<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="tz" uri="/WEB-INF/tld/fntld.tld" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'addPage.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=path %>/css/mine.css" type="text/css" rel="stylesheet">
	<link href="<%=path %>/css/custom.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=path %>/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="<%=path %>/js/user.js"></script>
	<script type="text/javascript" src="<%=path %>/js/dream_plugins.js"></script>
	<style type="text/css">
	.input{width:120px;}
	table {
	border: 1px;
	width: 98%;
	margin: 40px auto;
	border-collapse: collapse;
}

#table tr th,td {
	border: 1px solid #666;
	font-size: 15px;
	text-align: center;
	line-height: 33px;
}

#table tr th {
	font-size: 25px;
}
#table tr:hover{background: #ccc; cursor: pointer}
	</style>

  </head>
  
  <body>
  
   <div class="div_head">
		<span> <span style="float:left">当前位置是：用户管理  》 添加用户</span> <span
			style="float:right;margin-right: 8px;font-weight: bold"> <a
				style="text-decoration: none" href="./admin.php?c=goods&a=showlist">【主页】</a>
		</span>
		</span>
	</div>
    <fieldset>
    <legend>添加用户</legend>
    <form action="" name="userform" id="userform" method="post">
    <label>帐号:<input class="input" type="text" name="user.cusername" />   </label>&nbsp;
    <label>昵称:<input class="input" type="text" name="user.cshowname" />   </label>&nbsp;
    <label>电话:<input class="input" type="text" name="user.ctele" />   </label>&nbsp;
    <label>邮件:<input class="input" type="text" name="user.cemail" />   </label>&nbsp;
    <label>密码:<input class="input" type="password" name="user.cpassword" />   </label>&nbsp;
    <label>级别:<select class="input"  name="user.clevel">
    <option value="2">普通用户</option>
    <option value="1">超级管理员</option>
    </select>   </label>&nbsp;
    <label><input  type="button" value="提交" onclick="saveuser('userform','User_save')"/> </label>
    </form>
    </fieldset>
    
    <table id="table" cellpadding="0" cellspacing="0">
    <tr>
    <th>帐号</th>
    <th>昵称</th>
    <th>级别</th>
    <th>电话</th>
    <th>邮件</th>
    <th>注册时间</th>
    <th>上一次登录</th>
    <th colspan="2">操作</th>
    <th></th>
    </tr>
    <s:iterator value="#request.user">
    <tr>
    <td>${cusername}</td>
    <td>${cshowname}</td>
    <td>${tz:checkLimits(clevel)}</td>
    <td>${ctele}</td>
    <td>${cemail}</td>
    <td>${tz:dateFormat(cregtime,"yyyy/MM/dd HH:dd:ss")}</td>
    <td>${tz:dateFormat(clogintime,"yyyy/MM/dd HH:dd:ss")}</td>
    <td><a href="User_updatePage.action?user.cid=${cid}">修改</a> </td>
    <td><!-- 超级管理员不允许删除的 -->
    <s:if test="cusername !='admin'">
     <a onclick="deleteuser(${cid})" >删除</a>
    </s:if>
   </td>
    </tr>
    </s:iterator>
    </table>
  </body>
</html>
